package com.csmk.control;

import com.alibaba.fastjson2.JSONObject;

public enum TaskType{
    TASK_PERFORM_TOUCH("touch",RequestType.POST,null,param-> param instanceof JSONObject),
    TASK_RUN_SHELL("runShell",RequestType.POST,null,param-> param instanceof String),
    TASK_SWITCH_APP("switchApp",RequestType.GET,"pkgName",param-> param instanceof String),
    TASK_INPUT("input",RequestType.POST,null,param-> param instanceof String),
    TASK_MOVE_CURSOR("moveCursor",RequestType.GET,"num",(param)-> true),
    TASK_DEL("del",RequestType.GET,"num",(param)-> (param instanceof Integer)),
    TASK_HOME("pressHome",RequestType.GET,null,(param)-> true),
    TASK_SWITCH("doublePressHome",RequestType.GET,null,(param)-> true),
    TASK_SCREEN_SIZE("deviceInfo",RequestType.GET,"type",(param)-> true)
    ;

    final String url;

    final RequestType requestType;

    final ValidParamFunction validParamFunction;

    final String paramName;

    TaskType(String url, RequestType requestType,String paramName,ValidParamFunction validParamFunction) {
        this.url = url;
        this.requestType = requestType;
        this.paramName = paramName;
        this.validParamFunction = validParamFunction;
    }


}
